setClass("NVIEClusterScore",contains="ExternalClusterScore",
		prototype=prototype(
				.description=" Normalized Variation of Information External Score class"
		
		)
)  

#global functions
#methods

#calclustes Normalized Variation of Information External Score 
#for given classes and clusters
setMethod("ScoreSet",
		signature="NVIEClusterScore",
		definition=function(.Object,inputSet,clusters,...){
			#check for X, Y and clusters
			callNextMethod(.Object,inputSet,clusters,...)
			
			#C - clusters, L -labels (classes)
			HC		<- entropy(clusters)# H(clusters)
			HL 		<- entropy(inputSet$Y) ## H(L)
			
			HCcL	<-condentropy(clusters, inputSet$Y) #H(C|L)
			
			ICL <- HC - HCcL
			HCaL <- HCcL + HL #H(C;L)
			
			NVI <- 1- ICL/HCaL
		
			return(NVI) # [0,1] 0-good matched
		}
)    
